package com.amway.ll.controller;

import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.amway.ll.dao.EmployeeMapper;
import com.amway.ll.dao.TreeMapper;
import com.amway.ll.model.Employee;
import com.amway.ll.model.Tree;
import com.amway.ll.utils.BuildJsons;
import com.amway.ll.utils.MyConnFactory;

@Controller()
public class  TreeController{

	TreeMapper mapper = (TreeMapper) MyConnFactory.getMyConn().getConnection("TreeMapper");
	@RequestMapping("/gettree") 
	@ResponseBody()
	public String getEmployees(Tree e){
		String s = null;
		
		//EmployeeMapper mapper = (EmployeeMapper) MyConnFactory.getMyConn().getConnection("EmployeeMapper");

		List<Tree> tree = mapper.getTree();

		s = BuildJsons.getListJson(tree);
		
		return s;		
	}
	

}
